﻿
--给unity类型起别名,,相当于引入命名空间
-- local GameObject = UnityEngine.GameObject;
local ParticleSystem = UnityEngine.ParticleSystem;
local GameObject=UnityEngine.GameObject;
local PrimitiveType=UnityEngine.PrimitiveType;
local LuaCallCS = Vr40.LuaCallCS;
local LuaCallCSMono = Vr40.LuaCallCSMono;

--实例化游戏对象
local go = GameObject("lua_particle");
--C#的成员函数用：   静态函数用.
go:AddComponent(typeof(ParticleSystem));
GameObject.CreatePrimitive(PrimitiveType.Cube);


--普通类
local luacall=LuaCallCS();
luacall:Test1();
LuaCallCS.Test3();

--c#类
local go= GameObject("luacall")；
local luacall = go:AddComponent(typeof(LuaCallCSMono));
luacall:Test1();
print(luacall.adress)
local luacall2 = go:GetComponent(typeof(LuaCallCSMono));
luacall2:Test1();



